package com.company;

import com.sun.deploy.net.BasicHttpRequest;
import com.sun.deploy.net.HttpResponse;

import java.io.DataInputStream;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by v on 17-7-11.
 */
public class TestSocker {
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket=new ServerSocket(8000);
            Socket socket=serverSocket.accept();
            DataInputStream input=new DataInputStream(socket.getInputStream());
            while (true){
                System.out.println(input.readUTF());
            }
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
